{% extends "admin/base.html" %}
{% block title %} 发布文章 {% endblock %}
{% block menu %}
    {% set menu_current = 'post' %}
    {% include 'admin/menu.html' %}
{% endblock %}
{% block content %}
    <div id="where">当前位置：<span class="chosen">发布文章</span></div>
    <div id="post" class="content">
        <h3>发布文章</h3>
        <div class="form-box">
            <form method="post" action="">         
            <table cellspacing="0">
            <tbody>
            {% include 'admin/form_table.html' %}
                <tr>
                    <th></th>
                    <td><input type="submit" class="button" value="发布文章" /> 或 <input type="submit" class="button-2" name="draft" value="保存为草稿" /></td>
                </tr>
            </tbody>
            </table>
            </form>
        </div>
    </div>
{% endblock %}
{% block js %}
    <script type="text/javascript" src="/static/admin/js/xheditor/xheditor-zh-cn.min.js"></script>
    <script language="JavaScript" type="text/javascript">
    <!--
    $(function(){
        $('.pinyin').click(function(){
            var keyword = $('#title').attr('value');
            $.get(
                "{{ url_for('slug') }}",
                {'q':keyword},
                function(data){
                    $('#slug').attr('value',data);
                },
                'json'
            )
        })
        $('.translate').click(function(){
            var keyword = $('#title').attr('value');
            $.get(
                "{{ url_for('slug') }}",
                {'q':keyword,'fun':'translate'},
                function(data){
                    $('#slug').attr('value',data);
                },
                'json'
            )
        })
        $('#body').xheditor({upLinkUrl:"{{ url_for('upload') }}",upLinkExt:"zip,rar,txt",upImgUrl:"{{ url_for('upload') }}",upImgExt:"jpg,jpeg,gif,png",upFlashUrl:"{{ url_for('upload') }}",upFlashExt:"swf",upMediaUrl:"{{ url_for('upload') }}",upMediaExt:"wmv,avi,wma,mp3,mid",shortcuts:{'ctrl+enter':submitForm}});

        function submitForm(){$('form').submit();}
    }) 

    //-->
    </script>
{% endblock %}